#!/usr/bin/env node
const lnk = require("lnk");
const path = require("path");
const fs = require("fs");
const distWeb5 = path.resolve(__dirname, "../../../web5");
const confCenterSrcPath = path.resolve(__dirname, "../../../ConfCenter");
const linkConfCenter = path.resolve(__dirname, "../../../web5/ConfCenter");
fs.exists(distWeb5, (exists) => {
  if (!exists) {
    fs.mkdir(distWeb5, (err) => {
      if (err) {
        return console.log(err);
      }
      console.log("创建web5发布目录成功");
    });
  }
});

fs.exists(linkConfCenter,(exists)=>{
    if (!exists) {
        lnk([confCenterSrcPath], distWeb5).then(() =>console.log("创建web5发布目录链接成功"));      
    }
})
